package com.woniuxy.carlife.carlifeuserweb.mapper;

import com.woniuxy.carlife.carlifeuserweb.entity.Shippingaddress;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

/**
 * @author zjq
 * @ClassName:ShippingaddressMapper
 * @Description:用户地址
 * @date 2021/4/6 20:02
 **/

public interface ShippingaddressMapper extends BaseMapper<Shippingaddress> {
    /*
     * 功能描述〈修改掉其他地址默认地址只能有一个〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/14 23:00
     * @throws
     */

    @Update("UPDATE t_shippingaddress \n" +
            "SET shippingaddress_default=0 \n" +
            "WHERE user_id=#{userId} \n" +
            "AND shippingaddress_default=#{shippingaddressDefault}")
    public Boolean modifyShippingaddressDefaultByUserId(Integer userId,Integer shippingaddressDefault);



}
